package svc

import (
	"longbri/rpc/internal/config"
	"longbri/rpc/mysql"

	"github.com/zeromicro/go-zero/core/stores/sqlx"
)

type ServiceContext struct {
	Config        config.Config
	RankListModel mysql.TbFutuRankListModel
	ExceptNewsModel mysql.ExceptNewsModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:        c,
		RankListModel: mysql.NewTbFutuRankListModel(sqlx.NewMysql(c.DataSource)),
		ExceptNewsModel: mysql.NewExceptNewsModel(sqlx.NewMysql(c.DataSource)),
	}
}
